
a=[]
with open("hint.txt","rb") as f:
    a=f.read().decode().split(" ")

a2=[]
for i in a:
    a2.append(int(i))
print(a2)

def myhash(b,g,q,p):
    h = pow(g,b%q,p)
    return h
g = 47
q = 257
p = 1543

import string
str_1=string.printable

flag=""
flag_ord=[]
for i in range(len(a2)):
    for j in str_1:
        b=ord(j)
        h1=myhash(b,g,q,p)
        if h1==a2[i]:
            print(b)
            print(j)
            flag+=j
            flag_ord.append(b)
            continue
print(flag)
print(flag_ord)
#DASCT488caa75b2d7586e96f4c552ded3654}
def myhash(b,g,q,p):
    h = pow(g,b%q,p)
    return h
g = 47
q = 257
p = 1543

flag="DASCTF{488caa75b2d7586e96f4c552ded3654}"
flag1=flag[:9]
flag2=flag[9:]


g1=0
for i in flag:
    g1 = g1 + ord(i)
print(g1)

for i in range(1,200):
    g2=g1+i
    h1 = myhash(g2, g, q, p)
    if h1==1403:
        print(i)
        print(chr(i))
        break
print(flag1+"1"+flag2)